<?php
/*
 * 查询用户名是否存在
 */
include '../service/UserService.class.php';
header("Content-type:text/html;charset=utf-8");
$username = $_POST['username'];

$userService = new UserService();
$result = $userService->nameIsExist($username);
if($result == 0)
{
	$array = array('tip' => 0);       //用户名已经存在
	print_r(json_encode($array));
}else{
	$array = array('tip' => 1);       //用户名可以使用
	print_r(json_encode($array));
}